package hn.sigit.model.hnd.special;

import hn.sigit.model.hnd.administrative.HND_PermitRuleGroup;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@org.hibernate.annotations.Proxy(lazy=false)
@Table(name="SystemConfiguration", schema="hnd_special")
@Inheritance(strategy=InheritanceType.JOINED)
public class SystemConfiguration implements Serializable {
	private static final long serialVersionUID = 1L;

	private Long id;
	private String municipalityName;
	private HND_PermitRuleGroup buildingPermitRuleGroup;
	private HND_PermitRuleGroup operationPermitRuleGroup;
	
	
	@Id
	@Column(name="ID", nullable=false)
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="systemconfiguration_id_gen")
	@SequenceGenerator(name="systemconfiguration_id_gen", sequenceName="systemconfiguration_id_seq", allocationSize=1)
	public Long getId() {
		return id;
	}
	@SuppressWarnings("unused")
	private void setId(Long id) {
		this.id = id;
	}

	@Column(name="MunicipalityName", nullable=true)
	public String getMunicipalityName() {
		return municipalityName;
	}
	public void setMunicipalityName(String municipalityName) {
		this.municipalityName = municipalityName;
	}

	@ManyToOne(targetEntity=HND_PermitRuleGroup.class, optional=true, fetch=FetchType.LAZY)
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.LOCK})
	@JoinColumns({ @JoinColumn(name="BuildingPermitRuleGroupID", referencedColumnName="ID") })
	@org.hibernate.annotations.LazyToOne(value=org.hibernate.annotations.LazyToOneOption.NO_PROXY)
	public HND_PermitRuleGroup getBuildingPermitRuleGroup() {
		return buildingPermitRuleGroup;
	}
	public void setBuildingPermitRuleGroup(
			HND_PermitRuleGroup buildingPermitRuleGroup) {
		this.buildingPermitRuleGroup = buildingPermitRuleGroup;
	}

	@ManyToOne(targetEntity=HND_PermitRuleGroup.class, optional=true, fetch=FetchType.LAZY)
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.LOCK})
	@JoinColumns({ @JoinColumn(name="OperationPermitRuleGroupID", referencedColumnName="ID") })
	@org.hibernate.annotations.LazyToOne(value=org.hibernate.annotations.LazyToOneOption.NO_PROXY)
	public HND_PermitRuleGroup getOperationPermitRuleGroup() {
		return operationPermitRuleGroup;
	}
	public void setOperationPermitRuleGroup(
			HND_PermitRuleGroup operationPermitRuleGroup) {
		this.operationPermitRuleGroup = operationPermitRuleGroup;
	}
}
